//
//  LMQuestion.m
//  06-超级猜图
//
//  Created by apple on 15/7/23.
//  Copyright (c) 2015年 apple. All rights reserved.
//

#import "LMQuestion.h"

@implementation LMQuestion



- (instancetype)initWithDict:(NSDictionary *) dic
{
    self = [super init];
    if (self) {
//        self.answer = dic[@"answer"];
//        self.icon = dic[@"icon"];
//        self.title = dic[@"title"];
//        self.options = dic[@"options"];
        
        [self setValuesForKeysWithDictionary:dic];
    }
    return self;
}

+ (instancetype)questionWithDict:(NSDictionary *) dic
{
    return [[self alloc] initWithDict:dic];
}

+ (NSArray *)questions
{
    
    NSArray *arrays =[NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"questions.plist" ofType:nil]];
    
    
    NSMutableArray *arrayM = [NSMutableArray array];
    
    for (NSDictionary *dict in arrays) {
        LMQuestion *question = [LMQuestion questionWithDict:dict];
        
        [arrayM addObject:question];
    }
    return arrayM;
    
}

@end
